/**
 * Created by Antianlu on 14-5-7.
 */

var https = require('https');

/**
 * https.get的第一个参数如果为字符串会自动url.parse()转换为options的对象形式
 */
https.get('https://encrypted.google.com/', function(res) {
    console.log("statusCode: ", res.statusCode);
    console.log("headers: ", res.headers);

    res.on('data', function(d) {
        process.stdout.write(d);
    });

}).on('error', function(e) {
        console.error(e);
    });